﻿using System;
using System.Collections.Generic;
using System.Globalization;
using Locator.LcboServices.Common;
using Locator.LcboServices.Common.Properties;
using Locator.LcboServices.Common.Services;
using LcboServices.BusinessEntities;


namespace Locator.LcboService.Services
{
    internal class TestInventoryPageRetriever : PageRetriever<LcboInventoryData2>
    {
        private readonly static List<string> knownProductIds = new List<string>() { "904409", "198069", "53884" };
        protected override Uri BuildUrl(string parameter)
        {
            string myParameter;
            if (knownProductIds.Contains(parameter))
            {
                myParameter = parameter;
            }
            else
            {
                myParameter = String.Empty;
            }

            Uri theUri = new Uri(String.Format(CultureInfo.InvariantCulture, "http://localhost:{0}/productlocations{1}.aspx", Resources.TestWebPort, myParameter));
            return theUri;
        }

        public override bool CanRetrieveHtmlFor(Type lcboEntityType)
        {
            return lcboEntityType == typeof(LcboInventoryData2);
        }
    }
}
